﻿//
// Created by francklinson on 2021/3/16.
//

// 计算阶乘

#include <iostream>

using namespace std;

int func(int);

int main()
{
    int input;
    cout << "Enter a number: " << endl;
    cin >> input;
    cout << "The result is :" << func(input) << endl;
    return 0;
}

int func(int n)
{
    if (n == 1)
        return 1;
    else
        return func(n - 1) * n;
}